<template>
  <div class="AllInfor">
    <div v-for="(item, i) in information"
         :key="i"
         class="Infor"
         @click="ClickTitle(item.url)">
      <img v-if="item.isHot"
           src="../../assets/hot.gif" />
      <span class="space"
            v-if="!item.isHot"></span>
      <span :class="{hot:item.isHot}">{{item.title}}</span>
      <van-divider />
    </div>
  </div>
</template>

<script>
import { getInfomation } from '@/api/introduction'
export default {
  data () {
    return {
      information: []
    }
  },
  methods: {
    ClickTitle (url) {
      window.open(url)
    },
    fetch () {
      getInfomation().then(res => {
        this.information = res.data
      })
    }
  },
  created () {
    this.fetch()
  }
}
</script>
<style lang="less" scoped>
.AllInfor {
  padding-bottom: 50px;
  .Infor {
    background-color: #fff;
    padding: 0 10px;
    img {
      width: 30px;
    }
    span {
      font-size: 18px;
    }
    .hot {
      animation: colorChange 0.2s linear infinite;
    }
    @keyframes colorChange {
      to {
        color: red;
      }
    }
    .space {
      display: inline-block;
      width: 30px;
    }
    .van-divider {
      margin: 0;
      margin-top: 10px;
    }
  }
}
</style>
